package stack;

/**
 * @author Jonny Long
 * @date 2021/2/7 21:40
 */
public class Solution739 {
    public int[] dailyTemperatures(int[] T) {
        int len=T.length;
        int[] result=new int[len];
        for (int i = 0; i < len; i++) {
            int nowT=T[i];
            for (int j = i; j < len; j++) {
                if (nowT<T[j]){
                    result[i]=j-i;
                    break;
                }else {
                    result[i]=0;
                }
            }
        }
        //for (int i:result) {
        //    System.out.print(i+"\t");
        //}
        return result;
    }
}
